package com.file.manage.domain.entity.convertor;


import com.file.manage.domain.data.OperationLogsVO;
import com.file.manage.domain.entity.OperationLogs;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.NullValueCheckStrategy;
import org.mapstruct.factory.Mappers;

/**
 * @author H41
 * @Type UserConvertor.java
 * @date 2025/5/30 23:49
 * @Desc 文件转换器
 */

@Mapper(nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface OperationLogsConvertor {
    OperationLogsConvertor INSTANCE = Mappers.getMapper(OperationLogsConvertor.class);

    @Mapping(source = "creatorName", target = "createdByName")
    @Mapping(source = "modifierName", target = "updatedByName")
    @Mapping(source = "operationName", target = "typeName")
    @Mapping(source = "operationLog.type.name", target = "operationUserName")
    OperationLogsVO toFileVO(OperationLogs operationLog, String creatorName, String modifierName, String operationName);

}
